package com.house.rent.entity;

import java.io.Serializable;

/**
 * 用户信息实体
 */
public class UserEntity implements Serializable {

    private int id;
    private String mobile;
    private String password;
    private String nickName;
    private String idCardPhotoFront;
    private String idCardPhotoBack;
    /**
     * 0：普通用户 1：管理员
     */
    private String role;
    /**
     * 是否审核通过
     */
    private boolean audit;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getMobile() {
        if (mobile == null) {
            mobile = "";
        }
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getNickName() {
        if (nickName == null) {
            nickName = "";
        }
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getIdCardPhotoFront() {
        if (idCardPhotoFront == null) {
            idCardPhotoFront = "";
        }
        return idCardPhotoFront;
    }

    public void setIdCardPhotoFront(String idCardPhotoFront) {
        this.idCardPhotoFront = idCardPhotoFront;
    }

    public String getIdCardPhotoBack() {
        if (idCardPhotoBack == null) {
            idCardPhotoBack = "";
        }
        return idCardPhotoBack;
    }

    public void setIdCardPhotoBack(String idCardPhotoBack) {
        this.idCardPhotoBack = idCardPhotoBack;
    }

    public String getRole() {
        if (role == null) {
            role = "";
        }
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public boolean isAdmin() {
        return "1".equals(getRole());
    }

    public void setAdmin(boolean isAdmin) {
        setRole(isAdmin ? "1" : "0");
    }

    public boolean isAudit() {
        return audit;
    }

    public void setAudit(boolean audit) {
        this.audit = audit;
    }
}
